﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Stp.Core;

namespace Stp.Test
{
    [TestClass]
    public class AccountModelTest
    {
        [TestMethod]
        public void AccountModel_DefinitionTest()
        {
            AccountModel aModel = new AccountModel();
            aModel.AccountNumber = "accountnumbertest";
            aModel.DateCreated = DateTime.Today.ToShortDateString();
            aModel.Email = "emailtest";
            aModel.Password = Encoding.Unicode.GetBytes("passwordtest");
            aModel.Status = "registered";
            aModel.Country = "countrytest";
            aModel.Contact = new ContactModel();
            aModel.Contact.Name = "nametest";
            aModel.Contact.Phone = "1234567";
            aModel.Contact.Address = "addresstest";
            aModel.Contact.PreferedTime = "timetest";

            Assert.AreEqual("accountnumbertest", aModel.AccountNumber);
            Assert.AreEqual(DateTime.Today.ToShortDateString(), aModel.DateCreated);
            Assert.AreEqual("emailtest", aModel.Email);
            Assert.AreEqual("passwordtest", Encoding.Unicode.GetString(aModel.Password));
            Assert.AreEqual("registered", aModel.Status);
            Assert.AreEqual("countrytest", aModel.Country);
            Assert.AreEqual("nametest", aModel.Contact.Name);
            Assert.AreEqual("1234567", aModel.Contact.Phone);
            Assert.AreEqual("addresstest", aModel.Contact.Address);
            Assert.AreEqual("timetest", aModel.Contact.PreferedTime);
        }
    }
}
